home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,101 to 4,200 / aol-file-protocol-4400-4101-to-4200.zip / AOLDLs / ADV - Articles & Misc / Manual for ProDev DDT8_DDT16 / DDT.MANUAL.bxy / DDT.Manual / CHAPTER.9 (.txt) < prev    next >
AppleWorks Document  |  1993-08-05  |  13KB  |  248 lines

  1. O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
  2. O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
  3. $C826 DS 1 ;BIT 7=1= normal entry, bit 7=0 do RTS afte
  4. CHAPTER 9
  5. CUSTOMIZING
  6. CUSTOMIZING THE {DDT8}
  7. MEMORY LOCATIONS FOR DDT8
  8.      n = Slot number of ProDev DDT card
  9. $Cn00 = Initialize and enter the ProDev DDT.2
  10. $Cn03 = Initialize the ProDev DDT and do an RTS.*
  11. $Cn24 = Warmstart entry into ProDev DDT.
  12. LOCATIONS INSIDE ProDev DDT RAM.
  13.      Where your program's registers are saved.
  14. $C811 = Accumulator
  15. $C813 = X index
  16. $C815 = Y index
  17. $C817 = Stack Pointer
  18. $C81A = Processor Status$
  19. $C81B = Program counter (Low byte)#
  20. $C81C = Program counter (Hi byte)
  21. $C81D = Bank number
  22.      ProDev DDT8 FLAGS
  23. $C81E DS 1 ;"Text screen save": 0= off, bit 7=1= on?
  24. $C81F DS 1 ;CPU type: 0= 6502, bit 7=1= 65C02, bit 6=1= 65802D
  25. $C820 DS 1 ;I/O mode: 0= normal, bit 7=1= serial, bit 6=1= printer6
  26. $C821 DS 1 ;bit 7=1= don't send DDT output to screen
  27. EYou can use the following "start up" program to initialize the above K
  28. IFLAGS to your preference. Simply modify the program to provide the setup 
  29. you desire.
  30. ******************************************************************D
  31. *  ProDev DDT8 setup program                                     *D
  32. *                                                                *D
  33. *  replace "n" with the slot number of the ProDev DDT8 card.     *D
  34. ******************************************************************
  35. DDT8IN2   EQU  $Cn03     ;Enter here to initialize the DDT8A
  36. CARDOFF   EQU  $CFFF     ;Disable the peripheral cards 2K ROMs.,
  37. TEXTSAVE  EQU  $C81E     ;Text screen save?
  38. CPUTYPE   EQU  $C81F     ;CPU, $00=6502, $80=65C02, $40=65802D
  39. IOMODE    EQU  $C820     ;I/O, $00=Screen, $80=Serial, $40=PrinterA
  40. DISPLAY   EQU  $C821     ;DDT8 display On/Off switch, $80 = Off
  41. INITDDT8  BIT  CARDOFF   ;Disable all peripheral cards 2K ROMs7
  42.           JSR  DDT8IN2   ;Initialize DDT8 and return.-
  43.           BIT  $Cn00     ;Enable DDT8 card.
  44. * Set the Text screen save mode0
  45.           LDA  #0        ;Turn screen save off(
  46.           STA  TEXTSAVE  ;Set the flag
  47. * Select the CPU)
  48.           LDA  #$80      ;CPU type 6502(
  49.           STA  CPUTYPE   ;Set the flag
  50. * Select serial I/O.
  51.           STA  IOMODE    ;Set for serial I/O
  52. * Turn the display off. This will prevent the ProDev DDT fromD
  53. * changing the screen display of the target program, which is nice 
  54. * during serial I/O operation.,
  55.           STA  DISPLAY   ;Turn display off
  56. * The following two lines have the same effect as leaving the#
  57. * ProDev DDT via the "*" command.B
  58.           LDA  #$DC      ;Ignore interrupts & write protect DDT89
  59.           STA  $C80C     ;Talk directly to the VIA chip
  60.           RTS            ;Setup routine finished
  61. SUBROUTINES FOR "TRACE WITH SUBROUTINE" COMMAND
  62. "Bcc" - refers to any valid branch instruction.
  63. TEST A BYTE IN MEMORY
  64. TESTMEM LDA $ADDRESS  ;get contents of location to test.
  65.         CMP #$value   ;compare to some valueB
  66.         Bcc STOP      ;the condition was met so stop the program@
  67.         CLC           ;condition not met, clear the CARRY flag$
  68.         BCC LEAVE     ; and leave.?
  69. STOP    SEC           ;set the CARRY flag to stop the program-
  70. LEAVE   RTS           ;return to ProDev DDT
  71. TEST THE ACCUMULATOR
  72. TESTACC CMP #$value   ;compare to some valueB
  73.         Bcc STOP      ;the condition was met so stop the program@
  74.         CLC           ;condition not met, clear the CARRY flag$
  75.         BCC LEAVE     ; and leave.?
  76. STOP    SEC           ;set the CARRY flag to stop the program-
  77. LEAVE   RTS           ;return to ProDev DDT
  78. TEST THE X INDEX
  79. TESTX   CPX #$value   ;compare to some valueB
  80.         Bcc STOP      ;the condition was met so stop the program@
  81.         CLC           ;condition not met, clear the CARRY flag$
  82.         BCC LEAVE     ; and leave.?
  83. STOP    SEC           ;set the CARRY flag to stop the program
  84. LEAVE   RTS           ;return to ProDev DDT
  85. TEST THE Y INDEX
  86. TESTY   CPY #$value   ;compare to some valueB
  87.         Bcc STOP      ;the condition was met so stop the program@
  88.         CLC           ;condition not met, clear the CARRY flag$
  89.         BCC LEAVE     ; and leave.?
  90. STOP    SEC           ;set the CARRY flag to stop the program-
  91. LEAVE   RTS           ;return to ProDev DDT
  92. TEST THE STACK POINTER
  93. TESTSP  TSX           ;transfer the stack pointer to X index
  94.         INX           ;?
  95.         INX           ;correct for the JSR to your subroutine.
  96.         CPX #$value   ;compare to some valueB
  97.         Bcc STOP      ;the condition was met so stop the program@
  98.         CLC           ;condition not met, clear the CARRY flag$
  99.         BCC LEAVE     ; and leave.?
  100. STOP    SEC           ;set the CARRY flag to stop the program-
  101. LEAVE   RTS           ;return to ProDev DDT
  102. TEST THE LOW BYTE OF THE PROGRAM COUNTER
  103. TESTPC  CLC           ;clear CARRY flag9
  104.         LDA $C816     ;get low byte of pc from DDT8 RAM.
  105.         CMP #$value   ;compare to some valueB
  106.         Bcc STOP      ;the condition was met so stop the program@
  107.         CLC           ;condition not met, clear the CARRY flag$
  108.         BCC LEAVE     ; and leave.?
  109. STOP    SEC           ;set the CARRY flag to stop the program-
  110. LEAVE   RTS           ;return to ProDev DDT
  111. TEST THE PROCESSOR STATUS REGISTER
  112. TESTPS  CLC           ;clear CARRY flagC
  113.         LDA $C815     ;get the status register contents from DDT8.
  114.         CMP #$value   ;compare to some valueB
  115.         Bcc STOP      ;the condition was met so stop the program@
  116.         CLC           ;condition not met, clear the CARRY flag$
  117.         BCC LEAVE     ; and leave.?
  118. STOP    SEC           ;set the CARRY flag to stop the program-
  119. LEAVE   RTS           ;return to ProDev DDT
  120. CUSTOMIZING THE {DDT16}
  121. MEMORY LOCATIONS FOR DDT16
  122.      n = Slot number of ProDev DDT card
  123. $Cn00 = Initialize and enter the ProDev DDT.2
  124. $Cn04 = Initialize the ProDev DDT and do an RTS.*
  125. $Cn08 = Warmstart entry into ProDev DDT.
  126. LOCATIONS INSIDE ProDev DDT16 RAM.
  127.      --- Where your program's registers are saved ---
  128. $C811 DS 2 ;A
  129. $C813 DS 2 ;X
  130. $C815 DS 2 ;Y
  131. $C817 DS 2 ;S
  132. $C819 DS 2 ;D
  133. $C81B DS 1 ;B
  134. $C81C DS 1 ;M
  135. $C81D DS 1 ;Q
  136. $C81E DS 1 ;P
  137. $C81F DS 1 ;PC low byte
  138. $C820 DS 1 ;PC hi byte'
  139. $C821 DS 1 ;PBR Program Bank Register
  140.      --- DDT16 flags ---
  141. $C822 DS 1 ;"Text screen save": 0= off, bit 7=1= on?
  142. $C823 DS 1 ;CPU type: 0= 6502, bit 7=1= 65C02, bit 6=1= 65816D
  143. $C824 DS 1 ;I/O mode: 0= normal, bit 7=1= serial, bit 6=1= printer6
  144. $C825 DS 1 ;bit 7=1= don't send DDT output to screenB
  145. $C826 DS 1 ;BIT 7=1= normal entry, bit 7=0 do RTS after DDT init
  146. EYou can use the following "start up" program to initialize the above K
  147. IFLAGS to your preference. Simply modify the program to provide the setup 
  148. you desire.
  149. ******************************************************************D
  150. *  ProDev DDT16 setup program                                    *D
  151. *                                                                *D
  152. *  replace "n" with the slot number of the ProDev DDT card.      *D
  153. *  Call in emulation mode.                                       *D
  154. ******************************************************************
  155. DDT16IN   EQU  $Cn04     ;Enter here to initialize the DDT16A
  156. CARDOFF   EQU  $CFFF     ;Disable the peripheral cards 2K ROMs.,
  157. TEXTSAVE  EQU  $C822     ;Text screen save?
  158. CPUTYPE   EQU  $C823     ;CPU, $00=6502, $80=65C02, $40=65816D
  159. IOMODE    EQU  $C824     ;I/O, $00=Screen, $80=Serial, $40=Printer@
  160. DISPLAY   EQU  $C825     ;DDT display On/Off switch, $80 = Off
  161. INITDDT   BIT  CARDOFF   ;Disable all peripheral cards 2K ROMs6
  162.           JSR  DDT16IN   ;Initialize DDT and return.,
  163.           BIT  $Cn00     ;Enable DDT card.
  164. * Set the "Text screen save" mode0
  165.           STZ  TEXTSAVE  ;Turn screen save off
  166. * Select the CPU*
  167.           LDA  #$80      ;CPU type 65C02(
  168.           STA  CPUTYPE   ;Set the flag
  169. * Select serial I/O.
  170.           STA  IOMODE    ;Set for serial I/O
  171. * Turn the display off. This will prevent the ProDev DDT from6
  172. * changing the screen display of the target program.,
  173.           STA  DISPLAY   ;Turn display off
  174. * The following two lines have the same effect as leaving the$
  175. * ProDev DDT via the "**" command.B
  176.           LDA  #$DC      ;Ignore interrupts & write protect DDT89
  177.           STA  $C80C     ;Talk directly to the VIA chip2
  178.           RTS            ;Setup routine finished
  179. SUBROUTINES FOR "TRACE WITH SUBROUTINE" COMMAND
  180. "Bcc" - refers to any valid branch instruction.
  181. GThe DDT16 calls "TS" routines in 16 bit native mode with the following 
  182. register contents:
  183. A = targets Accumulator
  184. X = target's X
  185. Y = target's Y:
  186. P = target's status with I=1 to prevent interrupts.
  187. D = $0000
  188. B = $E0
  189. HThe direct page register "D" & data bank register "B" must be preserved 
  190. by your subroutine.
  191. TEST A BYTE IN MEMORY
  192. TESTMEM LDA $ADDRESS  ;get contents of location to test.
  193.         CMP #$value   ;compare to some valueB
  194.         Bcc STOP      ;the condition was met so stop the program@
  195.         CLC           ;condition not met, clear the CARRY flag$
  196.         BCC LEAVE     ; and leave.?
  197. STOP    SEC           ;set the CARRY flag to stop the program-
  198. LEAVE   RTL           ;return to ProDev DDT
  199. TEST THE ACCUMULATOR
  200. TESTACC CMP #$value   ;compare to some valueB
  201.         Bcc STOP      ;the condition was met so stop the program@
  202.         CLC           ;condition not met, clear the CARRY flag$
  203.         BCC LEAVE     ; and leave.?
  204. STOP    SEC           ;set the CARRY flag to stop the program-
  205. LEAVE   RTL           ;return to ProDev DDT
  206. TEST THE X INDEX
  207. TESTX   CPX #$value   ;compare to some valueB
  208.         Bcc STOP      ;the condition was met so stop the program@
  209.         CLC           ;condition not met, clear the CARRY flag$
  210.         BCC LEAVE     ; and leave.?
  211. STOP    SEC           ;set the CARRY flag to stop the program-
  212. LEAVE   RTL           ;return to ProDev DDT
  213. TEST THE Y INDEX
  214. TESTY   CPY #$value   ;compare to some valueB
  215.         Bcc STOP      ;the condition was met so stop the program@
  216.         CLC           ;condition not met, clear the CARRY flag$
  217.         BCC LEAVE     ; and leave.?
  218. STOP    SEC           ;set the CARRY flag to stop the program-
  219. LEAVE   RTL           ;return to ProDev DDT
  220. TEST THE STACK POINTER
  221. TESTSP  TSX           ;transfer the stack pointer to X index
  222.         INX           ;?
  223.         INX           ;correct for the JSR to your subroutine.
  224.         CPX #$value   ;compare to some valueB
  225.         Bcc STOP      ;the condition was met so stop the program@
  226.         CLC           ;condition not met, clear the CARRY flag$
  227.         BCC LEAVE     ; and leave.?
  228. STOP    SEC           ;set the CARRY flag to stop the program-
  229. LEAVE   RTL           ;return to ProDev DDT
  230. TEST THE LOW BYTE OF THE PROGRAM COUNTER
  231. TESTPC  CLC           ;clear CARRY flag8
  232.         LDA $C81F     ;get low byte of pc from DDT RAM.
  233.         CMP #$value   ;compare to some valueB
  234.         Bcc STOP      ;the condition was met so stop the program@
  235.         CLC           ;condition not met, clear the CARRY flag$
  236.         BCC LEAVE     ; and leave.?
  237. STOP    SEC           ;set the CARRY flag to stop the program-
  238. LEAVE   RTL           ;return to ProDev DDT
  239. TEST THE PROCESSOR STATUS REGISTER
  240. TESTPS  CLC           ;clear CARRY flagB
  241.         LDA $C81E     ;get the status register contents from DDT.
  242.         CMP #$value   ;compare to some valueB
  243.         Bcc STOP      ;the condition was met so stop the program@
  244.         CLC           ;condition not met, clear the CARRY flag$
  245.         BCC LEAVE     ; and leave.?
  246. STOP    SEC           ;set the CARRY flag to stop the program-
  247. LEAVE   RTL           ;return to ProDev DDT
  248.